/*
 * Author: hujingfei914@msn.com
 * Date:   2010-10-14
 * Description: A 3-d aircraft model containing position and orientation
 */

#pragma once
#include "..\stdafx.h"
#include "VRMLLoader.h"
#include "..\helisys\heli_sys_define\FlyStructDefine.h"

class CAircraft
{
private:
	CAircraft(void);
public:
	CAircraft(const char *filePath, 
		float x = 0.0f, float y = 0.0f, float z = 0.0f, 
		double xrot = 0.0, double yrot = 0.0, double zrot = 0.0);
	virtual ~CAircraft(void);

	// Draw 3d aircraft model
	void draw(void);
	// Update position and orientation
	void updatePositionAndOrientation(UINT nFlags, CPoint point);
	void updatePositionAndOrientation(const FlyState &flyState);

	// Setters and getters
	inline void setXrot(double xrot) {xrot_ = xrot;}
	inline double getXrot(void) {return xrot_;}
	inline void setYrot(double yrot) {yrot_ = yrot;}
	inline double getYrot(void) {return yrot_;}
	inline void setZrot(double zrot) {zrot_ = zrot;}
	inline double getZrot(void) {return zrot_;}

	inline void setX(float x) {x_ = x;}
	inline float getX(void) {return x_;}
	inline void setY(float y) {y_ = y;}
	inline float getY(void) {return y_;}
	inline void setZ(float z) {z_ = z;}
	inline float getZ(void) {return z_;}

private:
// Attributes
	std::vector<Mesh> meshes_;
	double xrot_, yrot_, zrot_;
	// Aircraft's position
	float x_, y_, z_;
};
